<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>Document</title>
        <style>
            .box{
                margin-top: 800px;

            }
        </style>
        <script>
            // jQuery(document).ready(function($) {
            //     $('.counter').counterUp({
            //         delay: 10,
            //         time: 1000
            //     });
            // });
        </script>
    </head>
    <body>
        <span class="counter">1,234,567.00</span>
        <span>$</span><span class="counter">1.99</span>
        <span class="counter">12345</span>
        <div class="box">
            <span class="counter">1,234,567.00</span>
            <span>$</span><span class="counter">1.99</span>
            <span class="counter">12345</span>
        </div>
        <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
        <script src="js/waypoints.min.js"></script>
        <script src="js/jquery.counterup.min.js"></script>
        <script>
        $(function(){
            // 1.基本使用
            // $(".counter").counterUp();
            // 1.设置每位数字的动画时长和总的动画时长
            $(".counter").counterUp({
                delay:1000,//The delay in milliseconds per number count up
                time:3000//The total duration of the count up animation
            });
            // var waypoint=$(".box").waypoint({
            //     handler:function(){
            //         $(".counter").counterUp({
            //             delay:10,
            //             time:1000
            //         })
            //     }
            // })
        })
        </script>
    </body>
</html>